#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<malloc.h>
int* selfDividingNumbers(int left, int right, int* returnSize) {
    int* p = (int*)malloc(sizeof(int) * (right - left));
    *returnSize = 0;
    for (int i = left; i <= right; i++)
    {
        int k = i, tmp = 0;
        while (k)
        {
            if (k % 10 != 0)
            {
                if ((i % (k % 10)) != 0)
                {
                    tmp = 1;
                    break;
                }
            }
            else
            {
                tmp = 1; 
                break;
            }
            k /= 10;
        }
        if (tmp == 0)
        {
            p[(*returnSize)++] = i;
        }
    }
    return p;
}




